﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Stonecode.Solar.ParticleEngine.SettingsTemplate
{
    /// <summary>
    /// Do not use. This is an old template
    /// </summary>
    [Obsolete()]
    public static class DisintegrateAlphaSettings
    {
        public static uint MaxParticles = 1000;

        public static string TextureName = "particle";

        public static TimeSpan Duration = TimeSpan.FromSeconds(4);

        public static float MinHorizontalVelocity = 0;
        public static float MaxHorizontalVelocity = 0;

        public static float MinVerticalVelocity = 0;
        public static float MaxVerticalVelocity = 0;

        // Create a wind effect by tilting the gravity vector sideways.
        public static Vector3 Gravity = new Vector3(0, 0, 0);

        public static float EndVelocity = 0f;

        public static float MinRotateSpeed = -1;
        public static float MaxRotateSpeed = 1;

        public static float MinStartSize = 1;
        public static float MaxStartSize = 3;

        public static float MinEndSize = 5;
        public static float MaxEndSize = 5;
        public static Color MaxColor = Color.Black;
        public static Color MinColor = Color.Black;

        public static Blend SourceBlend = Blend.SourceAlpha ;
        public static Blend DestinationBlend = Blend.InverseSourceAlpha;
        public static BlendFunction AlphaBlendOperation = BlendFunction.Add;
        public static BlendFunction BlendOperation = BlendFunction.Add;
        public static CompareFunction AlphaFunction = CompareFunction.Less;

        public static void CreateSettings(out EmitterSettings pSettings)
        {
            pSettings = new EmitterSettings(MaxParticles);
            pSettings.TextureName = TextureName;
            pSettings.Duration = Duration;
            pSettings.MinHorizontalVelocity = MinHorizontalVelocity;
            pSettings.MaxHorizontalVelocity = MaxHorizontalVelocity;
            pSettings.MinVerticalVelocity = MinVerticalVelocity;
            pSettings.MaxVerticalVelocity = MaxVerticalVelocity;
            pSettings.Gravity = Gravity;
            pSettings.EndVelocity = EndVelocity;
            pSettings.MinRotateSpeed = MinRotateSpeed;
            pSettings.MaxRotateSpeed = MaxRotateSpeed;
            pSettings.MinStartSize = MinStartSize;
            pSettings.MaxStartSize = MaxStartSize;
            pSettings.MinEndSize = MinEndSize;
            pSettings.MaxEndSize = MaxEndSize;
            pSettings.MaxColor = MaxColor;
            pSettings.MinColor = MinColor;
            //pSettings.SourceBlend = SourceBlend;
            //pSettings.DestinationBlend = DestinationBlend;
            //pSettings.BlendOperation = BlendOperation;
            //pSettings.AlphaFunction = AlphaFunction;
            //pSettings.AlphaBlendOperation = AlphaBlendOperation;

        }
    }
}
